<?php 
namespace app\admin\controller;
class SystemManage extends Base{
	public function site(){
		if($this->request->isPost() || $this->request->isAjax()){
			$data = input('post.');
			$data['id'] = 1;
			$res = db('site_config')->update($data);
			if( $res != 1 ){
				addAdminLog('编辑网站基本信息，操作失败');
				$data= ['err'=>1,'msg'=>'操作失败！'];
			   	return $data;
			}else{
				addAdminLog('编辑网站基本信息，操作成功');
				$data= ['err'=>0,'msg'=>'操作成功！'];
			   	return $data;
			}
		}else{
			$info = db('site_config')->where('id = 1 AND status = 0')->find();
			$this->assign('info',$info);
			return $this->fetch();
		}
	}
}